var myChart = echarts.init(document.getElementById("idx1"))
var option = {
    title:{
        text:'词云图--zzf',
    },
    series:{
        shape:'triangle',
        layout:'force',
        color:'green',
        type:'wordCloud',
        data:[
            {name:'郑智凡',value:50},
            {name:'zzz',value:10},
            {name:'aaa',value:10},
            {name:'qqq',value:10},
            {name:'www',value:10},
            {name:'eee',value:10},
        ],
    },
};
myChart.setOption(option)


var myChart2 = echarts.init(document.getElementById("idx2"))
var option2 = {
    title:{
        text:'关系图--zzf',
    },
    legend:{
        show:true,
    },
    series:{
        type:'graph',
        layout: 'force',
        force: {
            repulsion: 300,
        },
        roam: true,
        draggable: true,
        focusNodeAdjacency: true,
        label: {
            show: true,
        },
        categories: [{
            name: '恋人1',
            itemStyle: {
                color: 'red',
            },
        },{
            name: '恋人2',
            itemStyle: {
                color: 'yellow',
            },
        },{
            name: '恋人3',
            itemStyle: {
                color: 'black',
            },
        }],
        data: [{
            name: 'aaa',
            category: 0,
        },{
            name: 'bbb',
            category: 1,
        },{
            name: 'ccc',
            category: 0,
        },{
            name: 'ddd',
            category: 1,
        },{
            name: 'eee',
            category: 0,
        },{
            name: 'fff',
            category: 2,
        },],
        symbolSize: 30,
        links:[{
            source:0,
            target:1,
            label:{
                formatter:'恋人',
                show:true,
            },
        },{
            source:1,
            target:2,
            label:{
                formatter:'恋人',
                show:true,
            },
        },{
            source:2,
            target:3,
            label:{
                formatter:'恋人',
                show:true,
            },
        },{
            source:1,
            target:4,
            label:{
                formatter:'恋人',
                show:true,
            },
        },{
            source:4,
            target:5,
            label:{
                formatter:'恋人',
                show:true,
            },
        },{
            source:4,
            target:6,
            label:{
                formatter:'恋人',
                show:true,
            },
        }],
    }
};
myChart2.setOption(option2);

var myChart3 = echarts.init(document.getElementById("idx3"))
const gaugeData = [
    {
      value: 75,
      name: '已完成',
      title: {
        offsetCenter: ['0%', '40%']
      },
      detail: {
        valueAnimation: true,
        offsetCenter: ['0%', '0%']
      }
    },
  ];
var option3 = {
        series: [
          {
            type: 'gauge',
            startAngle: 90,
            endAngle: -270,
            pointer: {
              show: false
            },
            color:{
                type: 'linear',
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [{
                    offset: 0, color: 'red'
                }, {
                    offset: 1, color: 'blue'
                }],
                globalCoord: false
            },
            progress: {
              show: true,
              overlap: false,
              roundCap: true,
              clip: false,
              itemStyle: {
                borderWidth: 1,
                borderColor: '#464646'
              }
            },
            axisLine: {
              lineStyle: {
                width: 20
              }
            },
            splitLine: {
              show: false,
              distance: 0,
              length: 10
            },
            axisTick: {
              show: false
            },
            axisLabel: {
              show: false,
              distance: 50
            },
            data: gaugeData,
            title: {
              fontSize: 20
              
            },
            detail: {
              fontSize: 50,
              color: 'auto',
              borderColor: 'auto',
              formatter: '{value}%'
            }
          }
        ]
      };
myChart3.setOption(option3);

var myChart4 = echarts.init(document.getElementById("idx4"))
var option4 = {
    title: {
        text: '统计图--zzf',
    },
    geo: {
        map: '浙江',
        roam: true,
    },
    visualMap: {
        max:15,
        min:1,
        range:[0,17],
        inRand:{
            color:['red','green']
        },
        calculable:'true',
        top:'bottom',
        left:'center',
        orient:'horizontal',
    },
    series: [{
        type:'scatter',
        coordinateSystem: 'geo',
        data:[{
            name: '金华',
            value: [119.6,29,13],
        },{
            name: '丽水',
            value: [119.2,28,7],
        },{
            name: '温州',
            value: [120.6,28,12],
        },{
            name: '杭州',
            value: [120.1,30.2,17],
        },{
            name: '宁波',
            value: [121.37,29.5,15],
        },{
            name: '台州',
            value: [121.4,28.6,11],
        }],
        symbolSize: function(dataX){
            return dataX[2];
        },
    }],
};
myChart4.setOption(option4);